package cn.com.nes.mybatis.agent.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author nes
 * @since 2023-03-31
 */
@TableName("wx_payment_order")
public class WxPaymentOrder extends Model<WxPaymentOrder> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 应用id
     */
    private String appid;
    /**
     * 商户id
     */
    private String mchid;
    /**
     * 商户订单号
     */
    @TableField("out_trade_no")
    private String outTradeNo;
    /**
     * 微信支付订单号
     */
    @TableField("transaction_id")
    private String transactionId;
    /**
     * 交易类型，枚举值：;JSAPI：公众号支付;ATIVE：扫码支付;PP：APP支付;ICROPAY：付款码支付;WEB：H5支付;ACEPAY：刷脸支付
     */
    @TableField("trade_type")
    private String tradeType;
    /**
     * 交易状态，枚举值：;SUCCESS：支付成功;REFUND：转入退款;NOTPAY：未支付;CLOSED：已关闭;REVOKED：已撤销（仅付款码支付会返回）;USERPAYING：用户支付中（仅付款码支付会返回）;PAYERROR：支付失败（仅付款码支付会返回）
     */
    @TableField("trade_state")
    private String tradeState;
    /**
     * 付款银行
     */
    @TableField("bank_type")
    private String bankType;
    /**
     * 支付完成时间
     */
    @TableField("success_time")
    private Date successTime;
    /**
     * 用户在直连商户appid下的唯一标识。
     */
    @TableField("payer_openid")
    private String payerOpenid;
    /**
     * 系统用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 订单总金额
     */
    @TableField("total_amount")
    private Integer totalAmount;
    /**
     * 用户实际支付金额
     */
    @TableField("payer_total_amount")
    private Integer payerTotalAmount;

    /**
     * 二维码链接
     */
    @TableField("code_url")
    private String codeUrl;

    /**
     * 过期时间
     */
    @TableField("expire_time")
    private Date expireTime;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMchid() {
        return mchid;
    }

    public void setMchid(String mchid) {
        this.mchid = mchid;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public String getTradeState() {
        return tradeState;
    }

    public void setTradeState(String tradeState) {
        this.tradeState = tradeState;
    }

    public String getBankType() {
        return bankType;
    }

    public void setBankType(String bankType) {
        this.bankType = bankType;
    }

    public Date getSuccessTime() {
        return successTime;
    }

    public void setSuccessTime(Date successTime) {
        this.successTime = successTime;
    }

    public String getPayerOpenid() {
        return payerOpenid;
    }

    public void setPayerOpenid(String payerOpenid) {
        this.payerOpenid = payerOpenid;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Integer getPayerTotalAmount() {
        return payerTotalAmount;
    }

    public void setPayerTotalAmount(Integer payerTotalAmount) {
        this.payerTotalAmount = payerTotalAmount;
    }

    public static final String ID = "id";

    public static final String APPID = "appid";

    public static final String MCHID = "mchid";

    public static final String OUT_TRADE_NO = "out_trade_no";

    public static final String TRANSACTION_ID = "transaction_id";

    public static final String TRADE_TYPE = "trade_type";

    public static final String TRADE_STATE = "trade_state";

    public static final String BANK_TYPE = "bank_type";

    public static final String SUCCESS_TIME = "success_time";

    public static final String PAYER_OPENID = "payer_openid";

    public static final String USER_ID = "user_id";

    public static final String TOTAL_AMOUNT = "total_amount";

    public static final String PAYER_TOTAL_AMOUNT = "payer_total_amount";

    public static final String CODE_URL = "code_url";

    public static final String EXPIRE_TIME = "expire_time";

    @Override
    public Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "WxPaymentOrder{" +
                ", id=" + id +
                ", appid=" + appid +
                ", mchid=" + mchid +
                ", outTradeNo=" + outTradeNo +
                ", transactionId=" + transactionId +
                ", tradeType=" + tradeType +
                ", tradeState=" + tradeState +
                ", bankType=" + bankType +
                ", successTime=" + successTime +
                ", payerOpenid=" + payerOpenid +
                ", userId=" + userId +
                ", totalAmount=" + totalAmount +
                ", payerTotalAmount=" + payerTotalAmount +
                ", codeUrl=" + codeUrl +
                ", expireTime=" + expireTime +
                "}";
    }

    public String getCodeUrl() {
        return codeUrl;
    }

    public void setCodeUrl(String codeUrl) {
        this.codeUrl = codeUrl;
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }
}
